<template>
    <div>
            <div class="cut-item">
                <div class="title" :class="{'active': active == i}" @click="cut(i)" v-for="(v,i) in tabList" :key="i">
                    {{v.title}}
                </div>
            </div>
        <div class="cut-con">
            <slot name="default"></slot>
    </div>
    </div>

</template>

<script>
export default {
    props: ['tabList'],
    data() {
        return {
            active: 0
        }
    },
    methods: {
        cut(i) {
            this.active = i
            this.$emit('tabFn', this.active);
        }
    }
}
</script>

<style lang="scss">
.cut-item{
    margin-top: 50px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 50px;
    background-color: #fff;
    text-align: center;
    font-size: 18px;
}
.title {
    width: 100px;
    font-style: 18px;
    line-height: 50px;
}

.active {
    color: orangered;
    border-bottom: 2px solid orangered;
}
.cut-con{
    font-size: 18px;
}
</style>
